﻿@using System.Data;
@using System.Web;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Model;
@{
   Layout = "~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/Shared/_LayoutShow.cshtml";
   DTcms.Model.sites site = ViewData["site"] as DTcms.Model.sites;
   DTcms.Model.sysconfig config = ViewData["sysConfig"] as DTcms.Model.sysconfig;
   BaseController bc = ViewBag.BasePage as BaseController;
   DTcms.Model.orders m = ViewData["model"] as DTcms.Model.orders;
   ViewBag.Title = "查看订单 - " + site.name;
}

<!--当前位置-->
<div class="section">
  <div class="location">
    <span>当前位置：</span>
    <a href="@bc.linkurl("index")">首页</a> &gt;
        <a href="@bc.linkurl("usercenter", "index")">会员中心</a>
    <a href="@bc.linkurl("userorder", "list")">订单管理</a>
  </div>
</div>
<!--/当前位置-->

<div class="section clearfix">
  <!--左侧导航-->
  @RenderPage("~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/Shared/partial_ucenter_nav.cshtml")
  <!--/左侧导航-->
  <div class="right-auto">
    <!--右侧内容-->
    <div class="bg-wrap" style="min-height: 765px;">
      <div class="sub-tit">
        <a class="add" href="javascript:history.go(-1);"><i class="iconfont icon-reply"></i>返回</a>
        <ul>
          <li class="selected">
            <a href="javascript:;">查看订单</a>
          </li>
        </ul>
      </div>

      @if (m.status < 4) {
        <div class="order-progress @(m.payment_status > 0 ? "" : "mini")">
          <ul>
            <!--下单-->
            <li class="first active">
              <div class="progress">下单</div>
              <div class="info">@m.add_time</div>
            </li>
            <!--/下单-->

            @if (m.payment_status > 0) {
              <!--付款-->
              <li class="@(m.payment_status == 2 ? "active" : "")">
                <div class="progress">付款</div>
                <div class="info">@(m.payment_status == 2 ? m.payment_time.ToString() : "")</div>
              </li>
              <!--/付款-->
            }

            <!--确认-->
            <li class="@(m.status >= 2 ? "active" : "")">
              <div class="progress">确认</div>
              <div class="info">@(m.status >= 2 ? m.confirm_time.ToString() : "")</div>
            </li>
            <!--/确认-->

            <!--发货-->
            <li class="@(m.express_status == 2 ? "active" : "")">
              <div class="progress">发货</div>
              <div class="info">@(m.express_status == 2 ? m.express_time.ToString() : "")</div>
            </li>
            <!--发货-->

            <!--完成-->
            <li class="last @(m.status > 2 ? "active" : "")">
              <div class="progress">完成</div>
              <div class="info">@(m.status > 2 ? m.complete_time.ToString() : "")</div>
            </li>
            <!--完成-->
          </ul>
        </div>
      }

      <!--订单概述-->
      <div class="form-box accept-box">
        <dl class="head  form-group">
          <dd>订单号：@m.order_no
            @if (bc.get_order_payment_status(m.id)) {
              <a class="btn-pay" href="@bc.linkurl("payment", "?action=confirm&order_no=" + m.order_no)">去付款</a>
            }
          </dd>
        </dl>
        <dl class="form-group">
          <dt>订单状态：</dt>
          <dd>@bc.get_order_status(m.id)</dd>
        </dl>
        @if (m.payment_status > 0) {
          <dl class="form-group">
            <dt>支付方式：</dt>
            <dd>@bc.get_payment_title(m.payment_id)</dd>
          </dl>
        }
        @if (m.express_status == 2) {
          <dl class="form-group">
            <dt>发货单号：</dt>
            <dd>@bc.get_express_title(m.express_id) @m.express_no</dd>
          </dl>
          <dl class="form-group">
            <dt>物流信息：</dt>
            <dd>
              @ViewBag.expressdetail
            </dd>
          </dl>             
        }
      </div>
      <!--/订单概述-->

      <!--商品列表-->
      <div class="table-wrap">
        <table width="100%" border="0" cellspacing="0" cellpadding="5" class="ftable">
          <tr>
            <th align="left" colspan="2">商品信息</th>
            <th width="10%">
            单价</td>
            <th width="10%">积分</th>
            <th width="10%">数量</th>
            <th width="10%">金额</th>
            <th width="10%">积分</th>
          </tr>
          @if (m.order_goods != null) {
            foreach (DTcms.Model.order_goods mt in m.order_goods) {
            <tr>
              <td width="60">
                <a target="_blank" href="@bc.linkurl("goods_show", mt.article_id)">
                  <img src="@bc.get_article_img_url(mt.channel_id, mt.article_id)" class="img" />
                </a>
              </td>
              <td align="left">
                <a target="_blank" href="@bc.linkurl("goods_show", mt.article_id)">@mt.goods_title</a>
                <p>@mt.spec_text</p>
              </td>
              <td align="center">
                <s>￥@mt.goods_price</s>
                <p>￥@mt.real_price</p>
              </td>
              <td align="center">@(mt.point > 0 ? "+" : "")@mt.point</td>
              <td align="center">@mt.quantity</td>
              <td align="center">￥@(mt.real_price * mt.quantity)</td>
              <td align="center">@(mt.point * mt.quantity)</td>
            </tr>
            }
          }
          else {
            <tr>
              <td colspan="7" align="center">暂无记录</td>
            </tr>
          }
          <tr>
            <td colspan="7" align="right">
              <p>商品金额：<b class="red">￥@m.real_amount</b>&nbsp;&nbsp;+&nbsp;&nbsp;运费：<b class="red">￥@m.express_fee</b>&nbsp;&nbsp;+ &nbsp;&nbsp;支付手续费：<b class="red">￥@m.payment_fee</b>&nbsp;&nbsp;税费：<b class="red">@m.invoice_taxes</b></p>
              <p style="font-size: 22px;">应付总金额：<b class="red">￥@m.order_amount</b></p>
            </td>
          </tr>
        </table>
      </div>
      <!--/商品列表-->

      <!--收货信息-->
      <div class="form-box accept-box">
        <dl class="head form-group">
          <dd>收货信息</dd>
        </dl>
        <dl class="form-group">
          <dt>顾客姓名：</dt>
          <dd>@m.accept_name</dd>
        </dl>
        <dl class="form-group">
          <dt>送货地址：</dt>
          <dd>@m.area @m.address @m.post_code</dd>
        </dl>
        <dl class="form-group">
          <dt>联系电话：</dt>
          <dd>@m.mobile @m.telphone</dd>
        </dl>
        <dl class="form-group">
          <dt>电子邮箱：</dt>
          <dd>@m.email</dd>
        </dl>
        <dl class="form-group">
          <dt>备注留言：</dt>
          <dd>@m.message</dd>
        </dl>
        <dl class="form-group">
          <dt>开具发票：</dt>
          <dd>@(m.is_invoice == 1 ? "是" : "否")</dd>
        </dl>
        @if (m.is_invoice == 1) {
          <dl class="form-group">
            <dt>发票抬头：</dt>
            <dd>@m.invoice_title</dd>
          </dl>
        }
      </div>
      <!--/收货信息-->

    </div>
    <!--/右侧内容-->
  </div>
</div>
